﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace UniversitySolution
{
    class Faculty
    {
        public string name;
        public List<Chair> chairs = new List<Chair>();

        public static int facultyCount;

        public static Faculty GenetateRandomFaculty()
        {
            facultyCount++;
            Faculty faculty = new Faculty();
            faculty.name = "Faculty" + facultyCount;
            for (int i = 0; i < 3; i++)
            {
                Chair chr = Chair.GenerateRandomChair();
                faculty.chairs.Add(chr);
            }
            return faculty;
        }

        public void PrintFacultyToConsole()
        {
            Console.WriteLine("~~~~~~~~~~~~~~~~~");
            Console.WriteLine("Faculty name: {0}", name);
            foreach (var chr in chairs)
            {
                chr.PrintChairToConsole();
            }
        }
        
        public void GenerateFacultyParams()
        {
            facultyCount++;
            name = "Faculty" + facultyCount.ToString();
            for (int i = 0; i < 3; i++)
            {
                Chair chr = Chair.GenerateRandomChair();
                chairs.Add(chr);
            }
        }

        public void AverageMarksStudents()
        {
            Console.WriteLine("~~~~~~~~~~~~~~~~~");
            Console.WriteLine("Faculty name: {0}", name);
            foreach (var chr in chairs)
            {
                    chr.PrintChairToConsole();
            }
        }
    }
}
